package com.pigs.pigsordersystem.controller;


import com.pigs.pigsordersystem.entity.ProductEntity;
import com.pigs.pigsordersystem.entity.ResultFormat;
import com.pigs.pigsordersystem.entity.ResultFormatPaging;
import com.pigs.pigsordersystem.service.IProductService;
import com.pigs.pigsordersystem.util.ResultPagingUtil;
import com.pigs.pigsordersystem.util.ResultUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author Y.yang
 * @since 2020-03-14
 */
@RestController
@RequestMapping("product")
@Api(value = "/product",description = "产品表控制器")
public class ProductController {

    @Autowired
    private IProductService productService;

    /**
     * 显示产品信息
     * @return
     */
    @GetMapping("/queryProductList")
    @ApiOperation(value = "显示产品信息")
    public ResultFormatPaging queryProductList(){

        List<ProductEntity> productEntities = productService.queryProductList();
        return ResultPagingUtil.pagingSuccess(0,1,productEntities);
    }




}
